package com.common.www.bean.entity.global;

import org.springframework.boot.base.jpa.domain.entity.IEntity;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

@Entity
@DynamicUpdate(true)
@DynamicInsert(true)
@Getter
@Setter
@ToString()
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Table()
public class GlobalConfig implements IEntity {
    @Id
    @GeneratedValue(
            strategy = GenerationType.IDENTITY
    )
    @Column(
            length = 36,
            nullable = false
    )
    protected Long id;

    @Column(length = 256)
    private String name;

    //配置结果
    @Column(columnDefinition = "MEDIUMTEXT")
    private String value;
    /**
     * 配置描述
     */
    @Column(length = 256)
    private String description;

    public Long getId() {
        return this.id;
    }
}
